package org.witsoft.dtx.core;

import lombok.Getter;
import org.witsoft.dtx.domain.BranchTransaction;
import org.witsoft.dtx.domain.GlobalTransaction;

import java.util.ArrayList;
import java.util.List;

/**
 * @author XiaoQing Lin
 * @date 2020-09-18 20:08
 */
public class LocalTransaction {

    @Getter
    private GlobalTransaction global;

    @Getter
    private List<BranchTransaction> branches = new ArrayList<BranchTransaction>(3);

    public LocalTransaction(GlobalTransaction tx){
        this.global = tx;
    }

    public void addBranch(BranchTransaction tx){
        this.branches.add(tx);
    }

}
